	function further(className, pid) {
		var index = pid.replace(className, "");
		if (className == 'jobsubmit') {
			$confirm.modal();
			ptid = ldata[index].id;
		}
	}
function changepage(a) {
	if (a.innerHTML === '第一页')
		currentpage = 1;
	else if (a.innerHTML === '最末页')
		currentpage = pages;
	else if (a.innerHTML === '上一页')
		currentpage -= 1;
	else if (a.innerHTML === '下一页')
		currentpage += 1;
	else
		currentpage = a.innerHTML;

	drawPages($ul, currentpage, pages, 5);
	$pagecontainer.empty();
	getcontent(domain + '/showByTypeandPlace.do?type=' + selecttype
			+ '&country=' + selectcountry, currentpage, $pagecontainer);
	return false;
}
function getcondition(){
	
	var form = document.forms[0];
	var formData = new FormData(form);
	
	formData.append("type",selecttype);
	formData.append("districtid",selectcountry);
	return formData;
}
function getcount() {
	currentpage = 1;
	$ul.empty();
	$pagecontainer.empty();
  var formData=getcondition();
  
  sumitImageFile( function(data) {
		pages = data['count'];
		pages = Math.ceil(pages / 5)
		if (data['count'] != 0) {
			formData.append('page',currentpage);
			drawPages($ul, currentpage, pages, 5);

			getcontent(domain+'/api/pt/get.do',formData,$pagecontainer);
		}
	},domain+"/api/pt/count.do",formData,"get") 

}
function changecontent(item) {

	if (selecttype == '')
		selecttype = '0';
	$('#type' + selecttype).attr("class", "am-radius");
	$('#type' + item).attr("class", "am-badge am-badge-success am-radius");
	if (item != 0)
		selecttype = item;
	else {
		selecttype = '';
		$('#type0').attr("class", "am-badge am-badge-success am-radius");
	}
	getcount();
}
function changecontentcountry(daima) {
	if (selectcountry == curruntCity)
		selectcountry = 'country0';

	$('#' + selectcountry).attr("class", "am-radius");
	$('#' + daima).attr("class", "am-badge am-badge-success am-radius");
	if (daima != 0)
		selectcountry = daima;
	else {
		$('#country0').attr("class", "am-badge am-badge-success am-radius");
		selectcountry = curruntCity;
	}
	getcount();
}
function getcontent(url, getdata, $pagecontainer) {
	sumitImageFile(function(data) {
		ldata = data.result;
	
		drawEEContent($pagecontainer, data.result);
		
	},url,getdata,"get") ;
	

}

$("#selectsalarytype").change(function() { 
	
	getcount();
}); 
$("#selectvalidate").change(function() { 
	
	getcount();
}); 
$("#workdate").change(function() { 
	getcount();

}); 
var nowTemp = new Date();
var nowDay = new Date(nowTemp.getFullYear(), nowTemp.getMonth(),
		nowTemp.getDate(), 0, 0, 0, 0).valueOf();
var nowMoth = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), 1, 0,
		0, 0, 0).valueOf();
var nowYear = new Date(nowTemp.getFullYear(), 0, 1, 0, 0, 0, 0)
		.valueOf();
var $myStart2 = $('#workdate');
var checkin = $myStart2.datepicker({
	onRender : function(date, viewMode) {
		var viewDate = nowDay;
		switch (viewMode) {
		case 1:
			viewDate = nowMoth;
			break;
		case 2:
			viewDate = nowYear;
			break;
		}

		return date.valueOf() < viewDate ? 'am-disabled' : '';
	}
}).on('changeDate.datepicker.amui', function(ev) {
	
	checkin.close();
}).data('amui.datepicker');

var $confirm = myConfirm('我要报名', '你，确定要投递吗？', function() {

	myAjax(domain + '/commitJobRequest.do', {
		'ptjobid' : ptid
	}, function(data) {
		if (data.state == 'success')
			myAlert('提示', '报名成功!!!');
		else
			myAlert('提示', data.hint);

	})
}, function() {

});

